<html>
  <head>
    <meta name="viewport" content="width=device-width, initial-scale=1" charset="UTF-8">
    <title>com.drake.serialize.serialize</title>
<link href="../../images/logo-icon.svg" rel="icon" type="image/svg"><script>var pathToRoot = "../../";</script>    <script>const storage = localStorage.getItem("dokka-dark-mode")
const savedDarkMode = storage ? JSON.parse(storage) : false
if(savedDarkMode === true){
    document.getElementsByTagName("html")[0].classList.add("theme-dark")
}</script>
<script type="text/javascript" src="../../scripts/sourceset_dependencies.js" async="async"></script><link href="../../styles/style.css" rel="Stylesheet"><link href="../../styles/jetbrains-mono.css" rel="Stylesheet"><link href="../../styles/main.css" rel="Stylesheet"><link href="../../styles/prism.css" rel="Stylesheet"><link href="../../styles/logo-styles.css" rel="Stylesheet"><script type="text/javascript" src="../../scripts/clipboard.js" async="async"></script><script type="text/javascript" src="../../scripts/navigation-loader.js" async="async"></script><script type="text/javascript" src="../../scripts/platform-content-handler.js" async="async"></script><script type="text/javascript" src="../../scripts/main.js" defer="defer"></script><script type="text/javascript" src="../../scripts/prism.js" async="async"></script>  </head>
  <body>
    <div class="navigation-wrapper" id="navigation-wrapper">
      <div id="leftToggler"><span class="icon-toggler"></span></div>
      <div class="library-name"><a href="../../index.html">Serialize</a></div>
      <div></div>
      <div class="pull-right d-flex"><button id="theme-toggle-button"><span id="theme-toggle"></span></button>
        <div id="searchBar"></div>
      </div>
    </div>
    <div id="container">
      <div id="leftColumn">
        <div id="sideMenu"></div>
      </div>
      <div id="main">
        <div class="main-content" id="content" pageIds="Serialize::com.drake.serialize.serialize////PointingToDeclaration//1191130368">
          <div class="breadcrumbs"><a href="../../index.html">Serialize</a>/<a href="index.html">com.drake.serialize.serialize</a></div>
          <div class="cover ">
            <h1 class="cover"><span><span>Package</span></span> <span>com.</span><wbr></wbr><span>drake.</span><wbr></wbr><span>serialize.</span><wbr></wbr><span>serialize</span></h1>
          </div>
          <div class="tabbedcontent">
            <div class="tabs-section" tabs-section="tabs-section"><button class="section-tab" data-active="" data-togglable="Types">Types</button><button class="section-tab" data-togglable="Functions">Functions</button></div>
            <div class="tabs-section-body">
              <h2 class="">Types</h2>
              <div class="table" data-togglable="Types"><a data-name="-1315446916%2FClasslikes%2F1191130368" anchor-label="Serialize" id="-1315446916%2FClasslikes%2F1191130368" data-filterable-set=":serialize:dokkaHtml/release"></a>
                <div class="table-row" data-filterable-current=":serialize:dokkaHtml/release" data-filterable-set=":serialize:dokkaHtml/release">
                  <div class="main-subrow keyValue ">
                    <div class=""><span class="inline-flex">
                        <div><a href="-serialize/index.html"><span><span>Serialize</span></span></a></div>
<span class="anchor-wrapper"><span class="anchor-icon" pointing-to="-1315446916%2FClasslikes%2F1191130368"></span>
                          <div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
                        </span></span></div>
                    <div>
                      <div class="title">
                        <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-depenent-content" data-active="" data-togglable=":serialize:dokkaHtml/release"><div class="symbol monospace"><span class="token keyword">object </span><a href="-serialize/index.html">Serialize</a><span class="top-right-position"><span class="copy-icon"></span><div class="copy-popup-wrapper popup-to-left"><span class="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div></div></div>
                      </div>
                    </div>
                  </div>
                </div>
<a data-name="1256372761%2FClasslikes%2F1191130368" anchor-label="SerializeHook" id="1256372761%2FClasslikes%2F1191130368" data-filterable-set=":serialize:dokkaHtml/release"></a>
                <div class="table-row" data-filterable-current=":serialize:dokkaHtml/release" data-filterable-set=":serialize:dokkaHtml/release">
                  <div class="main-subrow keyValue ">
                    <div class=""><span class="inline-flex">
                        <div><a href="-serialize-hook/index.html"><span>Serialize</span><wbr></wbr><span><span>Hook</span></span></a></div>
<span class="anchor-wrapper"><span class="anchor-icon" pointing-to="1256372761%2FClasslikes%2F1191130368"></span>
                          <div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
                        </span></span></div>
                    <div>
                      <div class="title">
                        <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-depenent-content" data-active="" data-togglable=":serialize:dokkaHtml/release"><div class="symbol monospace"><span class="token keyword">interface </span><a href="-serialize-hook/index.html">SerializeHook</a><span class="top-right-position"><span class="copy-icon"></span><div class="copy-popup-wrapper popup-to-left"><span class="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div><div class="brief "><p class="paragraph">序列化接口</p></div></div></div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
              <h2 class="">Functions</h2>
              <div class="table" data-togglable="Functions"><a data-name="-1291596851%2FFunctions%2F1191130368" anchor-label="deserialize" id="-1291596851%2FFunctions%2F1191130368" data-filterable-set=":serialize:dokkaHtml/release"></a>
                <div class="table-row" data-filterable-current=":serialize:dokkaHtml/release" data-filterable-set=":serialize:dokkaHtml/release">
                  <div class="main-subrow keyValue ">
                    <div class=""><span class="inline-flex">
                        <div><a href="deserialize.html"><span><span>deserialize</span></span></a></div>
<span class="anchor-wrapper"><span class="anchor-icon" pointing-to="-1291596851%2FFunctions%2F1191130368"></span>
                          <div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
                        </span></span></div>
                    <div>
                      <div class="title">
                        <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-depenent-content" data-active="" data-togglable=":serialize:dokkaHtml/release"><div class="symbol monospace"><span class="token keyword">inline </span><span class="token keyword">fun </span><span class="token operator">&lt;</span><span class="token keyword"></span><a href="deserialize.html">T</a><span class="token operator">&gt; </span><a href="deserialize.html"><span class="token function">deserialize</span></a><span class="token punctuation">(</span>name<span class="token operator">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html">String</a><span class="token punctuation">, </span>defValue<span class="token operator">: </span><a href="deserialize.html">T</a><span class="token operator">?</span><span class="token operator"> = </span>null<span class="token punctuation">)</span><span class="token operator">: </span><a href="deserialize.html">T</a><span class="top-right-position"><span class="copy-icon"></span><div class="copy-popup-wrapper popup-to-left"><span class="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div><div class="symbol monospace"><span class="token keyword">inline </span><span class="token keyword">fun </span><span class="token operator">&lt;</span><span class="token keyword"></span><a href="deserialize.html">T</a><span class="token operator">&gt; </span><span data-unresolved-link="com.tencent.mmkv/MMKV///PointingToDeclaration/">MMKV</span><span class="token punctuation">.</span><a href="deserialize.html"><span class="token function">deserialize</span></a><span class="token punctuation">(</span>name<span class="token operator">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html">String</a><span class="token punctuation">, </span>defValue<span class="token operator">: </span><a href="deserialize.html">T</a><span class="token operator">?</span><span class="token operator"> = </span>null<span class="token punctuation">)</span><span class="token operator">: </span><a href="deserialize.html">T</a><span class="top-right-position"><span class="copy-icon"></span><div class="copy-popup-wrapper popup-to-left"><span class="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div><div class="brief "><p class="paragraph">根据<a href="deserialize.html">name</a>读取磁盘数据, 假设磁盘没有则返回<a href="deserialize.html">defValue</a>指定的默认值</p></div><div class="symbol monospace"><span class="token keyword"></span><span class="token keyword">fun </span><span class="token operator">&lt;</span><span class="token keyword"></span><a href="deserialize.html">T</a><span class="token operator">&gt; </span><span data-unresolved-link="com.tencent.mmkv/MMKV///PointingToDeclaration/">MMKV</span><span class="token punctuation">.</span><a href="deserialize.html"><span class="token function">deserialize</span></a><span class="token punctuation">(</span>type<span class="token operator">: </span><a href="https://developer.android.com/reference/kotlin/java/lang/Class.html">Class</a><span class="token operator">&lt;</span><span class="token keyword"></span><a href="deserialize.html">T</a><span class="token operator">&gt;</span><span class="token punctuation">, </span>name<span class="token operator">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html">String</a><span class="token punctuation">, </span>defValue<span class="token operator">: </span><a href="deserialize.html">T</a><span class="token operator">?</span><span class="token operator"> = </span>null<span class="token punctuation">)</span><span class="token operator">: </span><a href="deserialize.html">T</a><span class="top-right-position"><span class="copy-icon"></span><div class="copy-popup-wrapper popup-to-left"><span class="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div><div class="brief "><p class="paragraph">根据<a href="deserialize.html">name</a>读取磁盘数据, 即使读取的是基础类型磁盘不存在的话也会返回null</p></div></div></div>
                      </div>
                    </div>
                  </div>
                </div>
<a data-name="1032168711%2FFunctions%2F1191130368" anchor-label="serial" id="1032168711%2FFunctions%2F1191130368" data-filterable-set=":serialize:dokkaHtml/release"></a>
                <div class="table-row" data-filterable-current=":serialize:dokkaHtml/release" data-filterable-set=":serialize:dokkaHtml/release">
                  <div class="main-subrow keyValue ">
                    <div class=""><span class="inline-flex">
                        <div><a href="serial.html"><span><span>serial</span></span></a></div>
<span class="anchor-wrapper"><span class="anchor-icon" pointing-to="1032168711%2FFunctions%2F1191130368"></span>
                          <div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
                        </span></span></div>
                    <div>
                      <div class="title">
                        <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-depenent-content" data-active="" data-togglable=":serialize:dokkaHtml/release"><div class="symbol monospace"><span class="token keyword">inline </span><span class="token keyword">fun </span><span class="token operator">&lt;</span><span class="token keyword"></span><a href="serial.html">V</a><span class="token operator">&gt; </span><a href="serial.html"><span class="token function">serial</span></a><span class="token punctuation">(</span>default<span class="token operator">: </span><a href="serial.html">V</a><span class="token operator">?</span><span class="token operator"> = </span>null<span class="token punctuation">, </span><span class="token keyword">noinline </span>name<span class="token operator">: </span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token operator"> -&gt; </span><span class="token keyword"></span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html">String</a><span class="token operator">?</span><span class="token punctuation">, </span>kv<span class="token operator">: </span><span data-unresolved-link="com.tencent.mmkv/MMKV///PointingToDeclaration/">MMKV</span><span class="token operator">?</span><span class="token operator"> = </span>null<span class="token punctuation">)</span><span class="token operator">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.properties/-read-write-property/index.html">ReadWriteProperty</a><span class="token operator">&lt;</span><span class="token keyword"></span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html">Any</a><span class="token punctuation">, </span><span class="token keyword"></span><a href="serial.html">V</a><span class="token operator">&gt;</span><span class="top-right-position"><span class="copy-icon"></span><div class="copy-popup-wrapper popup-to-left"><span class="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div><div class="symbol monospace"><span class="token keyword">inline </span><span class="token keyword">fun </span><span class="token operator">&lt;</span><span class="token keyword"></span><a href="serial.html">V</a><span class="token operator">&gt; </span><a href="serial.html"><span class="token function">serial</span></a><span class="token punctuation">(</span>default<span class="token operator">: </span><a href="serial.html">V</a><span class="token operator">?</span><span class="token operator"> = </span>null<span class="token punctuation">, </span>name<span class="token operator">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html">String</a><span class="token operator">?</span><span class="token operator"> = </span>null<span class="token punctuation">, </span>kv<span class="token operator">: </span><span data-unresolved-link="com.tencent.mmkv/MMKV///PointingToDeclaration/">MMKV</span><span class="token operator">?</span><span class="token operator"> = </span>null<span class="token punctuation">)</span><span class="token operator">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.properties/-read-write-property/index.html">ReadWriteProperty</a><span class="token operator">&lt;</span><span class="token keyword"></span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html">Any</a><span class="token punctuation">, </span><span class="token keyword"></span><a href="serial.html">V</a><span class="token operator">&gt;</span><span class="top-right-position"><span class="copy-icon"></span><div class="copy-popup-wrapper popup-to-left"><span class="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div><div class="brief "><p class="paragraph">其修饰的属性字段的读写都会自动映射到本地磁盘 线程安全 本函数属于阻塞函数, 同步读写磁盘</p></div></div></div>
                      </div>
                    </div>
                  </div>
                </div>
<a data-name="-1038766966%2FFunctions%2F1191130368" anchor-label="serialize" id="-1038766966%2FFunctions%2F1191130368" data-filterable-set=":serialize:dokkaHtml/release"></a>
                <div class="table-row" data-filterable-current=":serialize:dokkaHtml/release" data-filterable-set=":serialize:dokkaHtml/release">
                  <div class="main-subrow keyValue ">
                    <div class=""><span class="inline-flex">
                        <div><a href="serialize.html"><span><span>serialize</span></span></a></div>
<span class="anchor-wrapper"><span class="anchor-icon" pointing-to="-1038766966%2FFunctions%2F1191130368"></span>
                          <div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
                        </span></span></div>
                    <div>
                      <div class="title">
                        <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-depenent-content" data-active="" data-togglable=":serialize:dokkaHtml/release"><div class="symbol monospace"><span class="token keyword"></span><span class="token keyword">fun </span><a href="serialize.html"><span class="token function">serialize</span></a><span class="token punctuation">(</span><span class="token keyword">vararg </span>params<span class="token operator">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-pair/index.html">Pair</a><span class="token operator">&lt;</span><span class="token keyword"></span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html">String</a><span class="token punctuation">, </span><span class="token keyword"></span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html">Any</a><span class="token operator">?</span><span class="token operator">&gt;</span><span class="token punctuation">)</span><span class="top-right-position"><span class="copy-icon"></span><div class="copy-popup-wrapper popup-to-left"><span class="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div><div class="symbol monospace"><span class="token keyword"></span><span class="token keyword">fun </span><span data-unresolved-link="com.tencent.mmkv/MMKV///PointingToDeclaration/">MMKV</span><span class="token punctuation">.</span><a href="serialize.html"><span class="token function">serialize</span></a><span class="token punctuation">(</span><span class="token keyword">vararg </span>params<span class="token operator">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-pair/index.html">Pair</a><span class="token operator">&lt;</span><span class="token keyword"></span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html">String</a><span class="token punctuation">, </span><span class="token keyword"></span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html">Any</a><span class="token operator">?</span><span class="token operator">&gt;</span><span class="token punctuation">)</span><span class="top-right-position"><span class="copy-icon"></span><div class="copy-popup-wrapper popup-to-left"><span class="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div><div class="brief "><p class="paragraph">将键值数据序列化存储到磁盘</p></div></div></div>
                      </div>
                    </div>
                  </div>
                </div>
<a data-name="-60791457%2FFunctions%2F1191130368" anchor-label="serialLazy" id="-60791457%2FFunctions%2F1191130368" data-filterable-set=":serialize:dokkaHtml/release"></a>
                <div class="table-row" data-filterable-current=":serialize:dokkaHtml/release" data-filterable-set=":serialize:dokkaHtml/release">
                  <div class="main-subrow keyValue ">
                    <div class=""><span class="inline-flex">
                        <div><a href="serial-lazy.html"><span>serial</span><wbr></wbr><span><span>Lazy</span></span></a></div>
<span class="anchor-wrapper"><span class="anchor-icon" pointing-to="-60791457%2FFunctions%2F1191130368"></span>
                          <div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
                        </span></span></div>
                    <div>
                      <div class="title">
                        <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-depenent-content" data-active="" data-togglable=":serialize:dokkaHtml/release"><div class="symbol monospace"><span class="token keyword">inline </span><span class="token keyword">fun </span><span class="token operator">&lt;</span><span class="token keyword"></span><a href="serial-lazy.html">V</a><span class="token operator">&gt; </span><a href="serial-lazy.html"><span class="token function">serialLazy</span></a><span class="token punctuation">(</span>default<span class="token operator">: </span><a href="serial-lazy.html">V</a><span class="token operator">?</span><span class="token operator"> = </span>null<span class="token punctuation">, </span><span class="token keyword">noinline </span>name<span class="token operator">: </span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token operator"> -&gt; </span><span class="token keyword"></span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html">String</a><span class="token operator">?</span><span class="token punctuation">, </span>kv<span class="token operator">: </span><span data-unresolved-link="com.tencent.mmkv/MMKV///PointingToDeclaration/">MMKV</span><span class="token operator">?</span><span class="token operator"> = </span>null<span class="token punctuation">)</span><span class="token operator">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.properties/-read-write-property/index.html">ReadWriteProperty</a><span class="token operator">&lt;</span><span class="token keyword"></span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html">Any</a><span class="token punctuation">, </span><span class="token keyword"></span><a href="serial-lazy.html">V</a><span class="token operator">&gt;</span><span class="top-right-position"><span class="copy-icon"></span><div class="copy-popup-wrapper popup-to-left"><span class="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div><div class="symbol monospace"><span class="token keyword">inline </span><span class="token keyword">fun </span><span class="token operator">&lt;</span><span class="token keyword"></span><a href="serial-lazy.html">V</a><span class="token operator">&gt; </span><a href="serial-lazy.html"><span class="token function">serialLazy</span></a><span class="token punctuation">(</span>default<span class="token operator">: </span><a href="serial-lazy.html">V</a><span class="token operator">?</span><span class="token operator"> = </span>null<span class="token punctuation">, </span>name<span class="token operator">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html">String</a><span class="token operator">?</span><span class="token operator"> = </span>null<span class="token punctuation">, </span>kv<span class="token operator">: </span><span data-unresolved-link="com.tencent.mmkv/MMKV///PointingToDeclaration/">MMKV</span><span class="token operator">?</span><span class="token operator"> = </span>null<span class="token punctuation">)</span><span class="token operator">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.properties/-read-write-property/index.html">ReadWriteProperty</a><span class="token operator">&lt;</span><span class="token keyword"></span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html">Any</a><span class="token punctuation">, </span><span class="token keyword"></span><a href="serial-lazy.html">V</a><span class="token operator">&gt;</span><span class="top-right-position"><span class="copy-icon"></span><div class="copy-popup-wrapper popup-to-left"><span class="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div><div class="brief "><p class="paragraph">其修饰的属性字段的读写都会自动映射到本地磁盘 和<a href="serial.html">serial</a>不同的是通过内存/磁盘双通道读写来优化读写性能 其修饰的属性字段第一次会读取磁盘数据, 然后拷贝到内存中, 后续都是直接读取内存中的拷贝 写入会优先写入到内存中的拷贝份, 然后通过子线程异步写入到磁盘 线程安全</p></div></div></div>
                      </div>
                    </div>
                  </div>
                </div>
<a data-name="1181425371%2FFunctions%2F1191130368" anchor-label="serialLiveData" id="1181425371%2FFunctions%2F1191130368" data-filterable-set=":serialize:dokkaHtml/release"></a>
                <div class="table-row" data-filterable-current=":serialize:dokkaHtml/release" data-filterable-set=":serialize:dokkaHtml/release">
                  <div class="main-subrow keyValue ">
                    <div class=""><span class="inline-flex">
                        <div><a href="serial-live-data.html"><span>serial</span><wbr></wbr><span>Live</span><wbr></wbr><span><span>Data</span></span></a></div>
<span class="anchor-wrapper"><span class="anchor-icon" pointing-to="1181425371%2FFunctions%2F1191130368"></span>
                          <div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
                        </span></span></div>
                    <div>
                      <div class="title">
                        <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-depenent-content" data-active="" data-togglable=":serialize:dokkaHtml/release"><div class="symbol monospace"><span class="token keyword">inline </span><span class="token keyword">fun </span><span class="token operator">&lt;</span><span class="token keyword"></span><a href="serial-live-data.html">V</a><span class="token operator">&gt; </span><a href="serial-live-data.html"><span class="token function">serialLiveData</span></a><span class="token punctuation">(</span>default<span class="token operator">: </span><a href="serial-live-data.html">V</a><span class="token operator">?</span><span class="token operator"> = </span>null<span class="token punctuation">, </span><span class="token keyword">noinline </span>name<span class="token operator">: </span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token operator"> -&gt; </span><span class="token keyword"></span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html">String</a><span class="token operator">?</span><span class="token punctuation">, </span>kv<span class="token operator">: </span><span data-unresolved-link="com.tencent.mmkv/MMKV///PointingToDeclaration/">MMKV</span><span class="token operator">?</span><span class="token operator"> = </span>null<span class="token punctuation">)</span><span class="token operator">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.properties/-read-only-property/index.html">ReadOnlyProperty</a><span class="token operator">&lt;</span><span class="token keyword"></span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html">Any</a><span class="token punctuation">, </span><span class="token keyword"></span><a href="https://developer.android.com/reference/kotlin/androidx/lifecycle/MutableLiveData.html">MutableLiveData</a><span class="token operator">&lt;</span><span class="token keyword"></span><a href="serial-live-data.html">V</a><span class="token operator">&gt;</span><span class="token operator">&gt;</span><span class="top-right-position"><span class="copy-icon"></span><div class="copy-popup-wrapper popup-to-left"><span class="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div><div class="symbol monospace"><span class="token keyword">inline </span><span class="token keyword">fun </span><span class="token operator">&lt;</span><span class="token keyword"></span><a href="serial-live-data.html">V</a><span class="token operator">&gt; </span><a href="serial-live-data.html"><span class="token function">serialLiveData</span></a><span class="token punctuation">(</span>default<span class="token operator">: </span><a href="serial-live-data.html">V</a><span class="token operator">?</span><span class="token operator"> = </span>null<span class="token punctuation">, </span>name<span class="token operator">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html">String</a><span class="token operator">?</span><span class="token operator"> = </span>null<span class="token punctuation">, </span>kv<span class="token operator">: </span><span data-unresolved-link="com.tencent.mmkv/MMKV///PointingToDeclaration/">MMKV</span><span class="token operator">?</span><span class="token operator"> = </span>null<span class="token punctuation">)</span><span class="token operator">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.properties/-read-only-property/index.html">ReadOnlyProperty</a><span class="token operator">&lt;</span><span class="token keyword"></span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html">Any</a><span class="token punctuation">, </span><span class="token keyword"></span><a href="https://developer.android.com/reference/kotlin/androidx/lifecycle/MutableLiveData.html">MutableLiveData</a><span class="token operator">&lt;</span><span class="token keyword"></span><a href="serial-live-data.html">V</a><span class="token operator">&gt;</span><span class="token operator">&gt;</span><span class="top-right-position"><span class="copy-icon"></span><div class="copy-popup-wrapper popup-to-left"><span class="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div><div class="brief "><p class="paragraph">可观察的数据来源<a href="https://developer.android.com/reference/kotlin/androidx/lifecycle/MutableLiveData.html">MutableLiveData</a> 其修饰的属性字段的读写都会自动映射到本地磁盘 和<a href="serial.html">serial</a>不同的是通过内存/磁盘双通道读写来优化读写性能 其修饰的属性字段第一次会读取磁盘数据, 然后拷贝到内存中, 后续都是直接读取内存中的拷贝 写入会优先写入到内存中的拷贝份, 然后通过子线程异步写入到磁盘 线程安全</p></div></div></div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
        <div class="footer"><span class="go-to-top-icon"><a href="#content" id="go-to-top-link"></a></span><span>© 2023 Copyright</span><span class="pull-right"><span>Generated by </span><a href="https://github.com/Kotlin/dokka"><span>dokka</span><span class="padded-icon"></span></a></span></div>
      </div>
    </div>
  </body>
</html>

